import request from "@/utils/request"

//获取学习类型
export function getAllStudyType(){
  return request({
      method: 'POST',
      url: '/studyservice/study-type/getAllStudyType/{page}/{limit}',
      headers: {
        'Content-Type': 'application/json'
      },
     
    }).then(res => res.data)
}

  
//获取学习资料
  export function getStudyBook(page,limit,queryVo){
    
    return request({
        method: 'POST',
        url:`/studyservice/study-data/getStudyDataByQueryVo/${page}/${limit}`,
        headers: {
          'Content-Type': 'application/json'
        },
        data: queryVo
      }).then(res => res.data)
  }

  //删除学习资料
  export function deleteStudyDataById(id){
    return request({
        method: 'DELETE',
        url: `/studyservice/study-data/deleteStudyDataById/${id}`,
        headers: {
          'Content-Type': 'application/json'
        },
      })}

      export function editStudyData(id,StudyInfo){
        return request({
            method: 'PUT',
            url: `/studyservice/study-data/updateStudyDataById/${id}`,
            headers: {
              'Content-Type': 'application/json'
            },
            data: StudyInfo
          })}

         
  export function newStudyBook(studyFormVo){
    
    return request({
        method: 'POST',
        url:'/studyservice/study-data/addStudyData',
        headers: {
          'Content-Type': 'application/json'
        },
        data: studyFormVo
      }).then(res => res)
  }

  

  export function newStudyBookType(StudyTypeInfo){
    
    return request({
        method: 'POST',
        url:'/studyservice/study-type/addStudyType',
        headers: {
          'Content-Type': 'application/json'
        },
        data: StudyTypeInfo
      }).then(res => res)
  }




  export function deleteStudyBookType(id){
    
    return request({
        method: 'DELETE',
        url:`/studyservice/study-type/deleteStudyTypeById/${id}`,
        headers: {
          'Content-Type': 'application/json'
        },
      }).then(res => res)
  }

 

  export function editStudyBookType(id,StudyTypeInfo){
    
    return request({
        method: 'PUT',
        url:`/studyservice/study-type/updateStudyTypeById/${id}`,
        headers: {
          'Content-Type': 'application/json'
        },
        data: StudyTypeInfo
      }).then(res => res)
  }
